package hibernate.model;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

@SuppressWarnings("serial")
@Entity
@Table(name = "resimler", catalog = "emmy")
@NamedQueries({
@NamedQuery(name = "findResAygitid",  query = "from Resimler where aygitid = :rAygitid"),
@NamedQuery(name = "findResResKonum", query = "from Resimler where resimKonum = :rResKonum")
})
public class Resimler implements java.io.Serializable {

	private Long resimid;
	private Aygit aygit;
	private String resimKonum;

	public Resimler() {
	}

	public Resimler(Aygit aygit, String resimKonum) {
		this.aygit = aygit;
		this.resimKonum = resimKonum;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "resimid", unique = true, nullable = false)
	public Long getResimid() {
		return this.resimid;
	}

	public void setResimid(Long resimid) {
		this.resimid = resimid;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "aygitid", nullable = false)
	public Aygit getAygit() {
		return this.aygit;
	}

	public void setAygit(Aygit aygit) {
		this.aygit = aygit;
	}

	@Column(name = "resimKonum", nullable = false, length = 150)
	public String getResimKonum() {
		return this.resimKonum;
	}

	public void setResimKonum(String resimKonum) {
		this.resimKonum = resimKonum;
	}
}